<link href="<?php echo $this->baseUrl(); ?>/ext/polyglot/css/polyglot-language-switcher.css" type="text/css" rel="stylesheet">
<script src="<?php echo $this->baseUrl(); ?>/ext/polyglot/js/persist-min.js" type="text/javascript"></script>
<script src="<?php echo $this->baseUrl(); ?>/ext/polyglot/js/jquery.timer.js" type="text/javascript"></script>
<script src="<?php echo $this->baseUrl(); ?>/ext/polyglot/js/jquery.polyglot.language.switcher.js" type="text/javascript"></script>
<?php $this->jQuery()->onLoadCaptureStart(); ?>
    $('#polyglotLanguageSwitcher').polyglotLanguageSwitcher({
        effect: 'fade',
        testMode: true,
        callback: function(el){
            var current = $('div#polyglotLanguageSwitcher a.current').attr('id');
            $('#changeLanguage input').val(current);
            $('#changeLanguage').submit();
            return false;
        }
    });
<?php $this->jQuery()->onLoadCaptureEnd(); ?>
<form method="post" id="changeLanguage">
   <input type="hidden" name="lang" />
</form>
<div id="polyglotLanguageSwitcher">
    <form>
        <select id="polyglot-language-options">
            <?php foreach ($this->languages as $language) : ?>
            <option id="<?php echo $language['key']; ?>" value="<?php echo $language['key']; ?>"<?php if ($language['current']) : ?> selected="selected"<?php endif; ?>>
                <?php echo $language['title']; ?>
            </option>
            <?php endforeach; ?>
        </select>
    </form>
</div>
